home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMIBEST2.ADF / Best of AMICUS 2 / Txt / txt.doc < prev    next >
Text File  |  1987-07-22  |  7KB  |  191 lines

  1. txt.doc                            1/7/87  22:25
  2.  
  3. AUTHOR:    Ray Lance
  4.     11 Riverside Drive
  5.     New York, NY 10023
  6.     (212) 874-4760
  7.     PLINK RL    CIS 76556,400    BIX rlance
  8.  
  9.         Copyright (c) 1986, 1987 by Ray Lance
  10.  
  11.    I finally got tired enough of fussing with various annoyingly different
  12. document formats, so tried to write a (slightly at least) generalized
  13. solution, and, thinking it might be useful to more than just myself, decided
  14. to release it as public domain, freely redistributable software, `shareware'.
  15. Distribution must be only of the whole arc file.  Contributions cheerfully
  16. accepted.
  17.  
  18.    Source is Lattice, Aztec, and MSC compatible.  Plain vanilla compiles/
  19. links in all cases except for Amiga Lattice 3.03 -- I couldn't find a unique
  20. predefined symbol not also used by 3.10, so you have to define "L303" either
  21. in the source (where it's commented out now) or in the compile command line
  22. (-dL303).  Aztec executable is included as it's the smallest.
  23.  
  24.  
  25.                 -----
  26.  
  27.  
  28. USAGE:    txt [options] input_filename [options] [output_filename] [options]
  29.  
  30.     If the output_filename is not specified, it will be generated as
  31. RAM:input_filename, minus any path.  This produces the output much faster
  32. than floppy-to-floppy.
  33.  
  34.     The options may appear anywhere you remember which one(s) are wanted,
  35. due to what I think is a kinda nifty little option processor (getopt(), q.v.,
  36. in the source code).
  37.  
  38.  
  39. -b    Don't delete the previous character on backspace; let the hex 08
  40.     (backspace character) be handled by the -c option.
  41.  
  42.     - Default (not specifying -b) is to delete the previous character
  43.       and discard this, the backspace character.
  44.  
  45.  
  46. -c[n]    Control characters (those below hex 20, except: backspace (0x08),
  47.     tab (0x09), formfeed (0x0c), and EOF (0x1a)) are omitted from the
  48.     output if n is not given or is 0, otherwise (n > 0, but not 255)
  49.     they are shoved up into the + 0x80 range for printing.
  50.  
  51.     - Default (not specifying -c) processes them through as they were.
  52.  
  53.  
  54. -d    Remove doublespacing: delete every other immediately consecutive
  55.     line-ending.  Needed to permit re-paragraphing of double-spaced
  56.     documents.
  57.  
  58.  
  59. -f    Don't remove extra formfeeds, but leave them under control of the -c
  60.     option above.
  61.  
  62.     - Default (not specifying -f) is reduction of multiple formfeeds to
  63.       only one, to avoid spitting paper.
  64.  
  65.  
  66. -h    Don't specially handle item headers, let them be re-paragraphed.
  67.  
  68.     - The default handling for item headers while re-paragraphing 
  69.       retains their specially formatted look.  An item header is defined
  70.       as the data between 2 identical lines consisting of only at least 4
  71.       identical characters, such as the Plink ---- and -----.
  72.  
  73.  
  74. -p    Reformat paragraphs to the current wordwrap line size.  Used in con-
  75.     junction with the wordwrap option (-w).
  76.  
  77.     A paragraph is defined as beginning when a line begins with a spacing
  78.     character as identified by isspace(): i.e., space, tab, formfeed, or
  79.     another line-ending character.
  80.  
  81.  
  82. -r[n]    n=0: change output line endings to carriage return only.  Both
  83.     carriage return and linefeed will be generated if n>0 (MSDOS
  84.     convention).
  85.  
  86.     - Default (not specifying -r), is Unix and AmigaDOS compatible:
  87.       linefeed only.
  88.  
  89.  
  90. -s[n]    Convert spaces to tabs when more than one space is used to get to a
  91.     tab column (spaced n apart); if n is not given or 0, n = 8.
  92.  
  93.  
  94. -t[n]    Tab spacing: convert tabs to spaces to align on columns n spaces
  95.     apart; if n is not given or 0, n = 8.
  96.  
  97.     - Default (not specifying -t) processes them through as is:  hex 09.
  98.  
  99.  
  100. -w[n]    Wordwrap after column n. If n is 0 or not given, n = 77 (for uEMACS).
  101.     The line is terminated after the first previous space or punctuation
  102.     as specified by ispunct().  If none of these is present in the line,
  103.     the line is terminated (\n) at column n+1.  Additonally, for "pretti-
  104.     ness", if the first space is more than 10 characters from the end of
  105.     the line and there is a punctuation mark closer to the end of the
  106.     line, the punctuation will be selected to end the line.
  107.  
  108.     254 is the maximum line width (wordwrap column #);
  109.        255, or -1, is used in all the options to mean the option was
  110.        NOT selected.
  111.  
  112.     - Default (not selecting this option, -w) is to retain line endings
  113.       where they are encountered.
  114.  
  115.  
  116. -z    Don't treat ^Z as end-of-file; let it be handled by the -c option.
  117.  
  118.  
  119. -x    Kills the default stripping of hex 80 bits which occurs before any
  120.     of the above.
  121.  
  122.  
  123. The options need not be separated by spaces, but each MUST be preceded by
  124. the hyphen (-).  The option characters are case sensitive (lowercase here).
  125.  
  126.  
  127.                 -----
  128.  
  129. DIFFERENCES BETWEEN AMIGADOS AND MSDOS VERSIONS:
  130.  
  131.     The default output path is RAM: in AmigaDos, whereas the first of
  132. TMP\ or ARCTEMP\, if found in the Environment, is selected in MSDOS.  If
  133. neither is found, RAM: is rejected as a path by MSDOS and the user must then
  134. give the entire path\filename.
  135.  
  136.     The default output line-ending is both carriage return and linefeed
  137. in MSDOS, rather than just linefeed, as in AMIGADOS or UNIX.  Input line-
  138. endings are always handled no matter where they come from or what environment
  139. you're running in now.
  140.  
  141.         AMIGADOS        MSDOS
  142.  
  143.     default:    linefeed        carriage return and linefeed
  144.     -r    output return only    delete return (output linefeed only)
  145.     -r9    output both cr/lf    delete linefeed (output return)
  146.  
  147.     These differences are reflected in the options listing given when
  148. you call the program with no parameters or just a ?  --  don't get confused
  149. though when some shells interpret the ? as a filename wildcard and start
  150. giving you one character filenames.  (Anybody got a good explanation for
  151. the resounding slowness of the Aztec version typeout of the options message?)
  152.  
  153.  
  154.                 -----
  155.  
  156.  
  157.             SAMPLE USES:
  158.  
  159.  
  160.  OPTIONS        Explanation
  161.  
  162.  txt file        DOS2DOS automatic conversion of line-endings only
  163.  
  164.  txt -w-p log        re-paragraph the day's Plink log to width 77 for
  165.             uEMACS or Brief.
  166.  
  167.  txt -d-w-p fcc.txt    re-paragraph the fcc.txt double-spaced text file
  168.  
  169.  txt -w80 file        Assure file has only 80 character lines for printing
  170.  
  171.  txt -t-s3 prog.c    Expand 8 char tabs to spaces coming in and change to
  172.             3 character tabs going out (source program from
  173.             uEMACS or XyWrite to be used in Brief)
  174.  
  175.  txt -t3-s ram:prog.c prog.c    Scoot it back from Brief to uEMACS.
  176.  
  177.  
  178.                 -----
  179.  
  180.  
  181.     This thing has grown like topsy.  I _WAS_ going to release it with
  182. re-paragraphing for Christmas, but ideas kept coming.  And bugs with them.
  183. Oh well, so it goes.
  184.  
  185.     Other ideas are welcome (I'm kinda tired of it right now, though, so
  186. might not be real quick to make further changes).  One thing that probably
  187. ought to happen to it is, when we have a proper piping capability, to change
  188. it to stdin/stdout and dispense with the file logic.
  189.  
  190. Ray Lance
  191.